package com.group01.community.controller;


import com.group01.community.entity.SysArea;
import com.group01.community.service.SysAreaService;
import com.group01.community.utils.ResponseResult;
import com.group01.community.utils.ResponseStatus;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 区域表 前端控制器
 * </p>
 *
 * @author guoyuan
 * @since 2025-05-01
 */
@Api(tags = "省市区三级")
@RestController
@RequestMapping("/sysArea")
public class SysAreaController {

    @Autowired
    private SysAreaService sysAreaService;

    @ApiOperation("获取地区级联树")
    @GetMapping("/tree")
    public ResponseResult<List<SysArea>> getAreaTree() {
        return new ResponseResult<List<SysArea>>(ResponseStatus.OK, sysAreaService.getAreaTree());
    }

}

